const mongoose = require('mongoose')
const moment = require('moment')

// 创建文章集合规则
const moodSchema = new mongoose.Schema({
  publishDate: {
    type: String,
    required: true,
    default: moment().format('YYYY-MM-DD HH:mm:ss')
  },
  content: {
    type: String,
    required: true
  },
  author: {
      type: String,
      required: false,
      default: ''
  },
  quote: {
      type: String,
      required: false,
      default: ''
  }
})

// 根据规则创建集合
const Mood = mongoose.model('Mood', moodSchema)

// 将集合规则作为模块成员进行导出
module.exports = {
  Mood
}